<?php
namespace app\index\controller;
use think\Db;

header('Access-Control-Allow-Origin:*');
header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept"); 

class Commend extends Base
{
	//今日推荐
    public function today()
    {
    	$commend=model('commend');
    	$data=$commend->alias('c')->join('td_food f','c.fid=f.id')->field('f.img_url,c.fid')->select();
    	if($data){
    		$res=array(
    			'status' =>0,
    			'info' =>$data
    		);
    	}else{
    		$res=array(
    			'status' =>1
    		);
    	}
    	echo json_encode($res);
    }
}
